from __future__ import annotations

from dataclasses import dataclass
from datetime import datetime, date
from typing import List, Dict, Optional


# 最小数据类定义，后续可按需求扩展字段与校验。


@dataclass
class PriceDaily:
    trade_date: date
    symbol: str
    open: float
    high: float
    low: float
    close: float
    volume: int
    turnover: float
    pre_close: float
    adj_factor: float
    is_suspended: bool
    limit_status: int
    circ_mv: Optional[float] = None
    turnover_rate: Optional[float] = None
    rps_250: Optional[float] = None
    is_new: Optional[bool] = None
    is_st: Optional[bool] = None


@dataclass
class StrongStockDaily:
    trade_date: date
    new_high_250: List[str]
    limit_up_list: List[str]


@dataclass
class Order:
    create_time: datetime
    symbol: str
    side: str
    order_type: str
    price: float
    qty: int
    status: str = "NEW"


@dataclass
class Position:
    strategy_id: str
    symbol: str
    qty: int
    cost_price: float
    last_price: float
    update_time: datetime




